////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//		File Name		:		CDocksLevelState.h
//
//		Author			:		Kevin Jordan
//
//		Purpose			:		A header for all functions and members of the Docks state
//
//		Dates			:		Written( March 5, 2011 ) by Kevin Jordan		LastUpdate( March 5, 2011  ) by Kevin Jordan 
//	
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include "CDocksLevelState.h"
#include "CMainMenuState.h"
#include "VIN_EventSystem.h"
#include "CHubState.h"
#include "SGD Wrappers/CSGD_DirectInput.h"
#include "SGD Wrappers/CSGD_Direct3D.h"
#include "SGD Wrappers/CSGD_TextureManager.h"
#include "CGame.h"
#include "VIN_BitMapFont.h"


CDocksLevelState::CDocksLevelState()
{



}


CDocksLevelState::~CDocksLevelState()
{






}


CDocksLevelState* CDocksLevelState::GetInstance()
{


	static CDocksLevelState instance;
	return &instance;


}


void CDocksLevelState::Render()
{
	CSGD_Direct3D* p = CSGD_Direct3D::GetInstance();
	VIN_BitMapFont* b = VIN_BitMapFont::GetInstance();
	p->Clear();

	CSGD_TextureManager::GetInstance()->Draw(ImageID, 0,0);

	RECT MenuRect;
	SetRect( &MenuRect, 100, 100, 700, 500 );

	RECT MenuRectII;
	SetRect( &MenuRectII, 85, 85, 715, 515 );

	CSGD_Direct3D::GetInstance()->GetSprite()->Flush();
	CSGD_Direct3D::GetInstance()->DrawRect( MenuRectII, 255,255,255);
	CSGD_Direct3D::GetInstance()->DrawRect( MenuRect, 0,0,0);

	b->Render("Use ARROW KEYS to move", 120, 120, 1.2f, D3DCOLOR_XRGB(255,0,0), MENUFONT);
	b->Render("Use X to punch", 120, 150, 1.2f, D3DCOLOR_XRGB(255,0,0), MENUFONT);
	b->Render("Use C  to dash", 120, 180, 1.2f, D3DCOLOR_XRGB(255,0,0), MENUFONT);
	b->Render("Use Z to trigger TNT", 120, 210, 1.2f, D3DCOLOR_XRGB(255,0,0), MENUFONT);
	b->Render("Use SPACE BAR to rage", 120, 240, 1.2f, D3DCOLOR_XRGB(255,0,0), MENUFONT);
	b->Render("Survive 3 rounds of 5 waves", 120, 270, 1.2f, D3DCOLOR_XRGB(255,0,0), MENUFONT);
	b->Render("Get the highscore!!", 120, 300, 1.2f, D3DCOLOR_XRGB(255,0,0), MENUFONT);
	b->Render("Have FUN!", 120, 330, 1.2f, D3DCOLOR_XRGB(255,0,0), MENUFONT);

	b->Render("press ESC to leave", 120, 370, 1.2f, D3DCOLOR_XRGB(255,0,0), MENUFONT);




}



void CDocksLevelState::Update(float fElapsedTime)
{





}


bool CDocksLevelState::Input()
{

	if(CSGD_DirectInput::GetInstance()->KeyDown(DIK_ESCAPE))
	{
		if(!CMainMenuState::GetInstance()->newbie)
		{
			CMainMenuState::GetInstance()->newbie = false;
			CGame::GetInstance()->ChangeState(CHubState::GetInstance());
			return true;
		}
		else
		{
			CGame::GetInstance()->ChangeState(CMainMenuState::GetInstance());
			CMainMenuState::GetInstance()->newbie = false;
			return true;
		}
	}
	
	return true;;
}


void CDocksLevelState::Enter()
{

	ImageID = CSGD_TextureManager::GetInstance()->LoadTexture("./resource/Graphics/Rio.png");
	VIN_SoundManager::GetInstance()->PlayBGM(BGM_OTHERMENUS);



}


void CDocksLevelState::Exit()
{


	CSGD_TextureManager::GetInstance()->UnloadTexture(ImageID);




}


void CDocksLevelState::HandleEvent( CEvent* pEvent )
{





}